#include <bits/stdc++.h>

using namespace std;

int main()
{
    int maxn=8,ans=0,p1,p2;
    for(int day=1;day<=7;day++){
            cin>>p1>>p2;
        if(maxn<p1+p2){
            maxn=p1+p2;
            ans=day;
        }
    }
    cout<<ans;
    return 0;
}
